[Nix] CI Fixes for nix flake check#552
Conversation
…t and will be triggered by nix file outside of project root
nix flake check (File Extension Trigger + Test Recent Commits)
nix flake check (File Extension Trigger + Test Recent Commits)nix flake check (File Changes Trigger + Recent Commits)
nix flake check (File Changes Trigger + Recent Commits)nix flake check
|
I made this Nix fix PR for you @mrjones2014, as discussed here! Thanks for all your efforts recently! 🙏🏻 |
|
Just to add a little extra context for whoever else reviews this to provide 2nd approval, I used Reason being that we were using a token for that and But since we recently learned that not approvals actually unfortunately don't count towards branch protection rules anyway and that job was deleted, and there are no tokens in the jobs anymore, |
|
Maybe @volodymyrZotov can take a 2nd look |
Overview
There are two changes here:
nix flake checkis triggered by changes to any .nix filenix flake checkruns against the most recent commits to the current branch (currently runs against the base branch used to create the PR)Type of change
Related Issue(s)
How To Test
I don't have the permissions to test this myself, but theoretically a maintainer can test this by doing the following:
nix flake checkto fail locally in the filenix/shell-plugins.nixnix flake checkdoes not trigger (you can check this here)'**.nix'from this PR, and observe here) again that now there should be a successful run ofnix flake check(even though we are expecting an error. This occurs because they are essentially run againstmainrather than the current branch's most recent commits).pull_request), and watch as the checks now should run against the most recent commit on this branch. We now expect them to failnix flake check, like it does locally.nix flake checkto fail, and watch as the checks should run successfully.Note: the above test may not work, as sometimes GitHub PRs won't allow the actions to be updated until after the PR is merged, so if there are any issues this should be considered as well.
A maintainer can run this action manually in order for the checks on this PR to pass: https://github.com/1Password/shell-plugins/actions/runs/17350571621 (or see "workflow awaiting approval" at the bottom of this PR description page where the CI checks are shown).
Changelog
GitHub CI for
nix flake checknow triggers for any.nixfile, not just the ones in the project root. Additionally, it now tests the most recent commits on the current branch rather than the branch the PR is based from.